.voice-selector {
  position: relative;
  display: inline-block;
  min-width: 120px;
}

.voice-selector-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.voice-selector-trigger:hover {
  background: var(--gray-50);
  border-color: var(--primary-500);
}

.current-voice {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.voice-icon {
  font-size: 16px;
}

.voice-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.voice-gender {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.voice-gender.女 {
  background: #fef2f2;
  color: #dc2626;
}

.voice-gender.男 {
  background: #eff6ff;
  color: #2563eb;
}

.dropdown-arrow {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.voice-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  margin-top: 4px;
  max-height: 400px;
  overflow: hidden;
}

.voice-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--gray-50);
}

.voice-dropdown-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--gray-200);
  color: var(--text-primary);
}

.voice-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
}

.voice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  position: relative;
}

.voice-item:hover {
  background: var(--gray-50);
}

.voice-item.active {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
}

.voice-item.active .voice-name {
  color: var(--primary-700);
  font-weight: 600;
}

.voice-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.voice-item .voice-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.voice-item .voice-gender {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.voice-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  flex: 1;
}

.voice-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--gray-100);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-preview:hover {
  background: var(--primary-100);
  color: var(--primary-600);
}

.preview-icon {
  font-size: 12px;
}

.preview-text {
  font-weight: 500;
}

/* 滚动条样式 */
.voice-list::-webkit-scrollbar {
  width: 6px;
}

.voice-list::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 3px;
}

.voice-list::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.voice-list::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .voice-selector {
    min-width: 100px;
  }
  
  .voice-selector-trigger {
    padding: 6px 10px;
  }
  
  .voice-name {
    font-size: 13px;
  }
  
  .voice-dropdown {
    left: -20px;
    right: -20px;
  }
  
  .voice-item {
    padding: 10px;
  }
  
  .voice-preview {
    padding: 4px 6px;
    font-size: 11px;
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .voice-selector-trigger {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
  }
  
  .voice-selector-trigger:hover {
    background: var(--gray-800);
    border-color: var(--primary-400);
  }
  
  .voice-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
  }
  
  .voice-dropdown-header {
    background: var(--gray-800);
    border-bottom-color: var(--border-light);
  }
  
  .voice-item:hover {
    background: var(--gray-800);
  }
  
  .voice-item.active {
    background: var(--primary-900);
    border-color: var(--primary-700);
  }
  
  .voice-preview {
    background: var(--gray-700);
    color: var(--text-secondary);
  }
  
  .voice-preview:hover {
    background: var(--primary-800);
    color: var(--primary-300);
  }
  
  .voice-list::-webkit-scrollbar-track {
    background: var(--gray-800);
  }
  
  .voice-list::-webkit-scrollbar-thumb {
    background: var(--gray-600);
  }
  
  .voice-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
  }
}
